print('python server ...')


from flask import Flask, session, redirect, url_for, escape, request , jsonify
from libs import router 

app = Flask(__name__)

app.config["JSON_AS_ASCII"] = False
app.debug = False


@app.route("/")
def route_root():
    return  'py server.'
@app.route("/pyapi/<category>/<method>")
def route_info(category, method):
    result ={
        "version":"rpc2023",
        "category":category,
        "method":method,
        "status":0,
        "datas":{},
        "params":{},
        "error":""
    }
    try: 
        router.router.callApi(result , request)
    except Exception as error:
        print(error)
    return  jsonify(result )
if __name__ == '__main__':
    print('00000000000000000000000000000000000000000000000000000000000000000000')
    app.run(debug=True,port=2000)

     